package org.wq.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.wq.po.TbUser;
import org.wq.service.UserService;

import java.util.List;

/**
 * Created by admin on 2016/11/28.
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;


    @RequestMapping(value = "/getAllUsers",method = RequestMethod.GET)
    public List<TbUser> getAllUsers() {
        return userService.findAll();
    }

    @RequestMapping("/getUserPage")
    public List<TbUser> getUserPage(int page, int rows) {
        return userService.getUserPage(page, rows);
    }

}
